import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: Home
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/newslist',
        component: () => import('../views/home/homoson/newsList.vue')
      },
    ]
  },
  {
    path: '/home/newslist',
    component: () => import('../views/home/homoson/newsList.vue')
  },
  {
    path: '/home/photolist',
    component: () => import('../views/home/homoson/photolist.vue')
  },
  {
    path: '/home/goodslist',
    component: () => import('../views/home/homoson/goodslist.vue')
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import(/* webpackChunkName: "about" */ '../views/search/index.vue')
  },
  {
    path: '/friends',
    name: 'Friends',
    component: () => import(/* webpackChunkName: "about" */ '../views/friends/index.vue')
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import(/* webpackChunkName: "about" */ '../views/cart/index.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
